<!--{subtemplate shop/sub/header}-->
<!--{subtemplate shop/sub/navigation_left}-->
<div class="row">
    <div class="detail_left">
    	<div class="row">
        	<div class="detail_box">
            	<h4><i class="head_box_style"></i><!--{lang chinh_sua_pham}--></h4>
                <div class="form_store">
                <!--{if !empty($post_erro)}-->
                    <div class="error">
                        <ul>
                    <!--{if $post_erro['pname']}--><li>{lang error_product_name}</li><!--{/if}-->
                    <!--{if $post_erro['pprice']}--><li>{lang error_product_price}</li><!--{/if}-->
                    <!--{if $post_erro['sales']['from']}--><li>{lang error_from_sales}</li><!--{/if}-->
                    <!--{if $post_erro['quantity']}--><li>{lang error_product_quantity}</li><!--{/if}-->
                    <!--{if $post_erro['tax']['tax_vat']}--><li>{lang error_tax_vat}</li><!--{/if}-->
                    <!--{if $post_erro['state']}--><li>{lang error_product_new_status}</li><!--{/if}-->
                    <!--{if $post_erro['summary']}--><li>{lang error_product_summary}</li><!--{/if}-->
                    <!--{if $post_erro['img_cover']}--><li>{lang error_img_default}</li><!--{/if}-->
                        </ul>
                        <p class="clear"></p>
                    </div>
				<!--{/if}-->
                	<form action="shop.php?mod=store&ac=post&do=edit&sid=$sid&pid=$pid" method="post" id="postproduct" onsubmit="return validate_form(this)" enctype="multipart/form-data">
                    	<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}" />
                        <input type="hidden" name="wysiwyg" id="{$editorid}_mode" value="$editormode" />
                        <input type="hidden" name="cid" value="$sid" />
                        <fieldset>
                        	<legend><!--{lang pro_title_basic}--></legend>
                            <div class="fm-req">
                                <label for="pname"><!--{lang product_name}--></label>
                                <input type="text" name="pname" id="pname" required="required" value="$product['pname']" tabindex="1" validate="{'minlen':'6', 'maxlen':80}" />
                                <p id="pname_alert" class="{if $post_erro['pname']}chk_erro{/if}" style="display:none">{lang error_product_name}</p>
                            </div>
                            <div class="fm-req">
                                <label for="pprice"><!--{lang product_price}--></label>
                                <input type="text" name="pprice" id="pprice" required="required" value="$gp['pprice']" tabindex="2" class="input_p" validate="{'minlen':'6', 'maxlen':17}" /> /
                                <select name="unit" id="unit">
                                <!--{loop $unit $value}-->
                                	<option value="$value"<!--{if ($product['unit'] == $value)} selected="selected"{/if}-->>$value</option>
                                <!--{/loop}-->
                                </select>
                                <p class="clear"></p>
                                <p id="pprice_alert" class="{if $post_erro['pprice']}chk_erro{/if}" style="display:none">{lang error_product_price}</p>
                            </div>
                            <div class="fm-opt">
                            	<label for="rate_sales"><!--{lang giam_gia}--></label>
                                <input type="text" name="sales[rate]" id="rate_sales" value="$product['sales']['rate']" class="input_t" /><i><!--{lang for_sale_tips}--></i>
                                <p class="clear"></p>
                                <div id="for_sale" {if ($product[sales][rate] == 0)}class="hide_div"{else}class="show_div"{/if}>
                                	<p>
                                    	<label for="from_sales"><!--{lang from_sales}--></label>
                                        <input type="text" name="sales[from]" id="from_sales" readonly="readonly" value="$gp['sales']['from']" class="calendar" />
                                        <i id="from_sales_alert" class="{if $post_erro['sales']['from']}chk_erro{/if}" style="display:none">{lang error_from_sales}</i>
                                    </p>
                                    <p>
                                    	<label for="end_sales"><!--{lang end_sales}--></label>
                                        <input type="text" name="sales[end]" id="end_sales" readonly="readonly" value="$gp['sales']['end']" class="calendar" />
                                        <p><!--{lang end_sales_tips}--></p>
                                    </p>
                                </div>
                            </div>
                            <div class="fm-req">
                                <label for="quantity"><!--{lang product_quantity}--></label>
                                <input type="text" name="quantity" id="quantity" value="$product['quantity']" required="required" tabindex="3" class="input_t" validate="{'minlen':'1', 'maxlen'3}" />
                                <i id="quantity_alert" class="{if $post_erro['quantity']}chk_erro{/if}" style="display:none">{lang error_product_quantity}</i>
                            </div>
                            <div class="fm-opt">
                            	<label for="tax"><!--{lang product_tax}--></label>
                                <input type="radio" name="tax[used]" id="tax" value="0" class="checkbox"<!--{if ($gp[tax][used] == 0)} checked="checked"{/if}--> /><i><!--{lang tax_yes}--></i>
                                <input type="radio" name="tax[used]" id="tax" value="1" class="checkbox"<!--{if ($gp[tax][used] == 1)} checked="checked"{/if}--> /><i><!--{lang tax_no}--></i>
                                <p class="clear"></p>
                                <div id="for_other_tax" {if ($gp[tax][used] == 0)}class="hide_div"{else}class="show_div"{/if}>
                                    <p>
                                        <label for="tax_vat"><!--{lang product_tax_vat}--></label>
                                        <input type="text" name="tax[tax_vat]" id="tax_vat" value="$gp['tax']['tax_vat']" tabindex="4" class="input_tax"{if ($gp[tax][used] == 0)} disabled="disabled"{/if} />
                                        <i id="tax_vat_alert" class="{if $post_erro['tax']['tax_vat']}chk_erro{/if}" style="display:none">{lang error_tax_vat}</i>
                                    </p>
                                    <p>
                                        <label for="tax_import"><!--{lang product_tax_import}--></label>
                                        <input type="text" name="tax[tax_import]" id="tax_import" value="$gp['tax']['tax_import']" tabindex="5" class="input_tax"{if ($gp[tax][used] == 0)} disabled="disabled"{/if} />
                                    </p>
                                    <p>
                                        <label for="tax_other"><!--{lang product_tax_other}--></label>
                                        <input type="text" name="tax[tax_other]" id="tax_other" value="$gp['tax']['tax_other']" tabindex="6" class="input_tax"{if ($gp[tax][used] == 0)} disabled="disabled"{/if} />
                                    </p>
                                </div>
                            </div>
                            <div class="fm-opt">
                                <label for="delivery_price"><!--{lang product_delivery_price}--></label>
                                <input type="text" name="delivery_price" id="delivery_price" value="$gp['delivery_price']" tabindex="7" class="input_p" />
                                <p class="clear"></p>
                                <p><!--{lang delivery_price_tips}--></p>
                            </div>
                            <div class="fm-opt">
                                <label for="state"><!--{lang product_new_status}--></label>
                                <input type="text" name="state" id="state" value="$product['state']" tabindex="7" class="input_tax" /><i><!--{lang product_new_status_tips}--></i>
                                <p class="clear"></p>
                                <p id="state_alert" class="{if $post_erro['state']}chk_erro{/if}" style="display:none">{lang error_product_new_status}</p>
                            </div>
                            <div class="fm-opt">
                            	<label for="status"><!--{lang kho_hang}--></label>
                                <select name="status" id="status">
                                <!--{loop $store_status $key $value}-->
                                	<option value="$key"<!--{if ($product['status'] == $key)} selected="selected"{/if}-->>$value</option>
                                <!--{/loop}-->
                                </select>
                            </div>
                            <div class="fm-req">
                                <label for="location_province"><!--{lang noi_ban}--></label>
                                <select name="location_province" id="location_province">
                                <!--{loop $provice $key $value}-->
                                	<option value="$key"<!--{if ($product['location_province'] == $key)} selected{/if}-->>$value['name']</option>
                                <!--{/loop}-->
                                </select>
                            </div>
                        </fieldset>
                        <fieldset>
                        	<legend><!--{lang chi_tiet_san_pham}--></legend>
                            <div class="fm-req">
                            	<label for="images"><!--{lang tom_tat_sp}--></label>
                                <textarea name="summary" id="summary" cols="10" rows="5" wrap="off"><!--{$product['summary']}--></textarea>
                                <p id="summary_alert" class="{if $post_erro['summary']}chk_erro{/if}" style="display:none">{lang error_product_summary}</p>
                                <p><!--{lang product_summary_tips}--></p>
                            </div>
                            <ul class="tabs">
                            	<li class="active" rel="tab1"><a><!--{lang thong_so_san_pham}--></a></li>
                                <li rel="tab2" id="imgList"><a><!--{lang anh_san_pham}--></a></li>
                                <li rel="tab3"><a><!--{lang tai_hinh_len}--></a></li>
                            </ul>
                            <div class="tab_container">
                            	<div id="tab1" class="tab_content">
                                	<!--{if $_G['shop']['param']}{eval echo param_explode($_G['shop']['param'], $gp['pparam']);}{/if}-->
                                </div>
                                <div id="tab2" class="tab_content">
                                	<input type="hidden" name="imgdefault" id="imgdefault" value="$product['img_cover']" />
                                	<ul id="list_unused" class="gallery"></ul>
                                    <div class="clear"></div>
                                    <h5 class="imgs_note"><!--{lang chu_y}--></h5>
                                    <ul class="info_img"><!--{lang img_upload_tips}--></ul>
                                </div>
                                <div id="tab3" class="tab_content">
                                <!--{if ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage'])}-->
                                    <!--{if $_G['setting']['swfupload'] != 0}-->
                                    <div id="{$editorid}_multiimg">
										<script type="text/javascript">
										$('{$editorid}_multiimg').innerHTML = AC_FL_RunContent(
											'width', '770', 'height', '300',
											'src', '{IMGDIR}/upload.swf?site={$_G[siteroot]}misc.php%3fmod=swfupload%26type=image%26sid=$sid&type=image&random=<!--{echo random(4)}-->',
											'quality', 'high',
											'id', 'swfupload',
											'menu', 'true',
											'allowScriptAccess', 'always',
											'wmode', 'transparent'
										);
                                        </script>
                                    </div>
                                    <!--{/if}-->
                                    <div class="clear"></div>
                                    <h5 class="imgs_note"><!--{lang chu_y}--></h5>
                                    <ul class="info_img">{lang img_upload_tips_2}<li>{lang img_upload_tips_3}<b>{$allowuploadsize}</b></li><!--{if ($_G['adminid'] != 1)}<li>{lang img_upload_tips_4}<b>{$allowuploadnum}</b></li>{/if}--></ul>
                                <!--{/if}-->
                                </div>
                            </div>
                        </fieldset>
                        <!--{subtemplate shop/store/post_editor_body}-->
                        <fieldset>
                        	<legend>&nbsp;</legend>
                        	<div class="fm-req">
                                <!--{subtemplate shop/store/seccheck}-->
                            </div>
                        </fieldset>
                        <div id="fm-submit" class="fm-req">
                        	<input type="hidden" name="submit" value="true" />
                        	<input type="submit" id="submitform" value="{lang dang_san_pham_moi}" />
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="detail_right">
        <!--{subtemplate shop/store/store_menu}-->
    </div>
    <div class="clear"></div>
</div>
<!--{subtemplate shop/sub/footer}-->